Network devices such as firewalls, routers, and proxies filter and inspect network traffic flowing through the device. These devices are primarily focused on security and enhancing the efficiency of network traffic flow. In addition, some network devices transform packets from one protocol to another, perform content-based routing, perform application-based load sharing, and provide a host of other sophisticated features. However, while these network devices are aware of an application layer protocol (HTTP, SMTP, JMS, etc.), they do not understand the actual state of the application. Thus, there is a need for a network device, such as a mediating or proxy server, for ascertaining application state.